package top.jimc.spring.annotation;

import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author Jimc.
 * @since 2018/9/27.
 */
public class Customer {

//    1.在字段上使用
//    @Autowired
    private Person person;

//    2.在构造方法上使用
    @Autowired
    public Customer(Person person) {
        this.person = person;
    }

    public Person getPerson() {
        return person;
    }

//    3.在setter方法上使用
//    @Autowired
    public void setPerson(Person person) {
        this.person = person;
    }
}
